package com.xja.seckill.service.impl;

import com.xja.seckill.order.commons.JsonBean;
import com.xja.seckill.order.domain.mapper.SkuMapper;
import com.xja.seckill.order.domain.model.Sku;
import com.xja.seckill.service.SkuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SkuServiceImpl implements SkuService {

    @Autowired
    private SkuMapper skuMapper;

    @Override
    public JsonBean rollBackCount(Integer id) {
        Sku sku = skuMapper.selectByPrimaryKey (id);
        sku.setCount (sku.getCount ()+1);
        return new JsonBean(0,"库存回滚成功",null);
    }
}
